class Solution(object):
    def decode(self, encoded, first):
        """
        :type encoded: List[int]
        :type first: int
        :rtype: List[int]
        """
        ans = [first]
        for num in encoded:
            ans.append(ans[-1]^num)
        return ans
if __name__ == '__main__':
    encoded = [6,2,7,3]
    first = 4
    print(Solution().decode(encoded, first))